name: ESLint check

on:
  push:
    branches: [ "main", "dev"]
  pull_request: 
    branches: [ "main"]

env:
  CI: true

jobs:
  eslint:
    name: Run eslint scanning
    runs-on: ubuntu-latest
    permissions:
      contents: read
      security-events: write
      actions: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Install ESLint for frontend
        run: |
          npm install eslint -C frontend
          npm install eslint-plugin-import -C frontend
          npm install eslint-plugin-functional -C frontend
          npm install eslint-plugin-jsx-a11y -C frontend
          npm install eslint-plugin-react -C frontend
          npm install eslint-plugin-react-hooks -C frontend

      - name: Run ESLint
        run: make lint-frontend
        continue-on-error: true